package com.qf.entiy.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qf.entiy.base.BaseDto;


import java.util.Date;

@TableName("`order`")
public class Order extends BaseDto {
    @TableField("order_id")
    private String orderId;
    @TableField("phone")
    private String phone;
    @TableField("name")
    private String name;
    @TableField("goods_id")
    private Long goodsId;
    @TableField("num")
    private Long num;
    @TableField("province")
    private String province;
    @TableField("city")
    private String city;
    @TableField("area")
    private String area;
    @TableField("address")
    private String address;
    @TableField("remark")
    private String remark;
    @TableField("pay_type")
    private Long payType;
    @TableField("sku_id")
    private Long skuId;
    @TableField("pay_state")
    private Long payState;
    @TableField("create_time")
    private Date createTime;
    @TableField("price")
    private Integer price;
    @TableField("merchantuser_id")
    private Long merchantUserId;

    public Order(String orderId, String phone, String name, Long goodsId, Long num, String province, String city, String area, String address, String reamrk, Long payType, Long skuId, Long payState, Date createTime, Integer price, Long merchantUserId) {
        this.orderId = orderId;
        this.phone = phone;
        this.name = name;
        this.goodsId = goodsId;
        this.num = num;
        this.province = province;
        this.city = city;
        this.area = area;
        this.address = address;
        this.remark = remark;
        this.payType = payType;
        this.skuId = skuId;
        this.payState = payState;
        this.createTime = createTime;
        this.price = price;
        this.merchantUserId = merchantUserId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Long getNum() {
        return num;
    }

    public void setNum(Long num) {
        this.num = num;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String reamrk) {
        this.remark = reamrk;
    }

    public Long getPayType() {
        return payType;
    }

    public void setPayType(Long payType) {
        this.payType = payType;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Long getPayState() {
        return payState;
    }

    public void setPayState(Long payState) {
        this.payState = payState;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Long getMerchantUserId() {
        return merchantUserId;
    }

    public void setMerchantUserId(Long merchantUserId) {
        this.merchantUserId = merchantUserId;
    }

    public Order() {
    }

    //枚举
    public enum payState{
        PENDING(0L, "待付款"),
        PAID(1L, "已付款");

        private Long code;
        private String description;

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        payState(Long code, String description) {
            this.code = code;
            this.description = description;
        }
        public static payState get(Long code) {
            for (payState payState : values()) {
                if (payState.getCode() == code) {
                    return payState;
                }
            }
            return null;
        }
    }


}